//
//  XSDelViewController.m
//  XSDataBaseDemo
//
//  Created by 大帅 on 2023/12/19.
//

#import "XSDelViewController.h"

@interface XSDelViewController ()

@end

@implementation XSDelViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.navigationItem.title = @"删";
    self.view.backgroundColor = [UIColor.orangeColor colorWithAlphaComponent:1];
    
    UILabel *lab = [[UILabel alloc] init];
    lab.text = @"点击空白删除最后一条数据";
    [self.view addSubview:lab];
    [lab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_equalTo(self.view);
    }];
    
}

-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    
    NSArray *arr = [[XSDataSaveManager sharedManager] lookDownloadAllData];
    if (arr.count > 0) {
        // 模拟删除最后一条数据
        [[XSDataSaveManager sharedManager] deleteDownloadSingleData:arr.lastObject];
    }
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
